package Test2;

public class GoodsTest {
    public static void main(String[] args) {
        Goods []arr = new Goods[3];
        Goods g1 = new Goods("001","P40",5999.9,50);
        Goods g2 = new Goods("002","保温杯",122.0,40);
        Goods g3 = new Goods("003","枸杞",29.9,30);
        arr[0] = g1;
        arr[1] = g2;
        arr[2] = g2;
        for (Goods goods : arr) {
            System.out.println("id:" + goods.getId() + "    名字:" + goods.getName() + "    价格:" + goods.getPrice()
                    + "    数量:" + goods.getCount());
        }
    }
}
